package ch06.home;

class Exercise6_04 {
	public static void main(String args[]) {
		Student s = new Student();
		s.name = "HongGilDong";
		s.ban = 1;
		s.no = 1;
		s.kor = 100;
		s.eng = 60;
		s.math = 76;

		System.out.println("name: " + s.name);
		System.out.println("total: " + s.getTotal());
		System.out.println("average: " + s.getAverage());
	}
}

//<1
class Student {
	String name;
	int ban;
	int no;
	int kor;
	int eng;
	int math;

	int getTotal() {
		return kor + eng + math;
	}

	float getAverage() {
		return (int) (getTotal() / 3f * 10 + 0.5f) / 10f;
	}
}
//1>
/*
name: HongGilDong
total: 236
average: 78.7
*/